{% extends "base.html" %}  

{% block title %}WIFI Test{% endblock %}

{% block main %}
<!-- <h3>SDIO WIFI Test Report On RT600</h3> -->
    <div class="container-fluid" id="main-body">
        <div class="row">
            <div class="col-md-12">
                
                <form class="form-horizontal from-inline" id="form1" enctype="multipart/form-data" action="http://dapeng/dapeng/edit/request/0/" method="post" onkeydown="if(event.keyCode==13){return false;}" onsubmit="return false">
                    <input type="hidden" name="csrfmiddlewaretoken" value="qy9OUrTNo2dwoNYFXL4qvmBeBJqEaKxtAbT1rpN0CA7aYQDYs3Yalv7mwcSLvqdh">

                    <div class="d-flex flex-row justify-content-center mb-3 mt-4">
                        <div class="d-flex justify-content-center">
                            <div class="mx-1" style="width:180px;">
                                <label class="">Project</label>
                                <input class="form-control form-control-sm input-group-sm dapeng-input-filter" name="name" id="name" type="text">
                            </div>
                        
                            <div class="mx-1" style="width:180px;">
                                <label class="">Type</label>
                                <select class="form-control form-control-sm input-group-sm dapeng-select-filter" name="requesttype" id="requesttype" type="select"><option value=""></option><option value="1">Pool</option><option value="2">Clone</option><option value="3">Stabilit</option> </select>
                            </div>
                            <div class="mx-1" style="width:180px;">
                                <label> Date Range</label>
                                <input type="text" id="date_range" class="form-control form-control-sm input-group-sm dapeng-select-filter">
                            </div>
                            <div class="mx-1" style="width:180px;">
                                <label class="">Operator</label>
                                <select class="form-control form-control-sm input-group-sm dapeng-select-filter" name="systemid" id="systemid" type="select"><option value=""></option><option value="1">Windows</option><option value="2">Linux</option><option value="3">Mac</option></select>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
     </div>
  <div id="main_block"> 
      {% include 'records_content.html' %}

      <div>
          <!-- class="pagination-sm pagination" to display samll pagination -->
          <ul id="page-container" class=" justify-content-center" ></ul>
      </div>

  </div>
  <script type="text/javascript">
      page_size = parseInt('{{ page_size }}'),    
      $('#page-container').twbsPagination({
        totalPages: parseInt('{{ records_count }}'/page_size),
        visiblePages: 10,
        onPageClick: function (event, page) {
         $.ajax({
              type : 'get',               
              url : '/cellbank/records_content/'+ page,
              error : function() {
                  alert('请求失败 ');
              },
              success : function(data) {
                  $('#records_content').html(data) ;
              }
         });

          $('#page-content').text('Page ' + page);
        }
      });
  </script>
   <script type="text/javascript">
      $(document).ready(function() {

        $('#date_range').focus(function(){
          updateConfig();
        });
        

        function updateConfig() {
          var options = {};

        
    
            options.timePicker = true;
          
          
            options.autoApply = true;

           
            options.ranges = {
              'Today': [moment(), moment()],
              'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
              'Last 7 Days': [moment().subtract(6, 'days'), moment()],
              'Last 30 Days': [moment().subtract(29, 'days'), moment()],
              'This Month': [moment().startOf('month'), moment().endOf('month')],
              'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
            };
           

         

          $('#date_range').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); }).click();;
          
        }

      });
      </script>
{% endblock %}  
